package entity.DiscoverRecommend;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 15-10-21.
 */
public class DiscoverRecommendSpecial extends DiscoverRecommendItem   {
    private List<SpecialItem> spItem;

    public List<SpecialItem> getSpItem() {
        return spItem;
    }

    public void setSpItem(List<SpecialItem> spItem) {
        this.spItem = spItem;
    }

    private int ret;
    public void parseJSON(JSONObject json) throws JSONException {
        super.parseJSON(json);
        ret=json.optInt("ret", 0);
        spItem=new ArrayList<>();
        JSONArray array=json.getJSONArray("list");
        for (int i = 0; i <array.length() ; i++) {
            JSONObject itm=array.getJSONObject(i);
            SpecialItem special=new SpecialItem();
            special.parseJSON(itm);
            spItem.add(special);
        }
    }

}
